<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理后台</title>
<link href="Css/css.css" rel="stylesheet" type="text/css" />
<link href="Css/default1.css.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="Include/swfupload.js"></script>
<script type="text/javascript" src="Js/fileprogress.js"></script>
<script type="text/javascript" src="Js/handlers.js"></script>
<script language="javascript" src="Js/calendar.js"></script>
<script language="javascript" type="text/javascript">
<!--
function fnOnBack() {
	var url = '<?php echo url('BoDashboard', 'Welcome'); ?>';
	document.location.href = url;
}

function fnOnSubmit(form) {
	form.Save.disabled = true;
	if (form.title.value == '')
	{
		alert('请填写作品名称');
		form.Save.disabled = false;
		return false;
	}
	if (form.pcid.value == 0)
	{
		alert('请选择作品类别');
		form.Save.disabled = false;
		return false;
	}

	return true;
}

// -->
</script>
<script type="text/javascript">
		var swfu;

		window.onload = function() {
			var settings = {
				flash_url : "Include/swfupload.swf",
				upload_url: "index.php?controller=BoProduct&action=upload",	// Relative to the SWF file
				post_params: {"PHPSESSID" : "<?php echo session_id(); ?>"},
				file_size_limit : "100 MB",
				file_types : "*.*",
				file_types_description : "All Files",
				file_upload_limit : 100,
				file_queue_limit : 0,
				custom_settings : {
					progressTarget : "fsUploadProgress",
					cancelButtonId : "btnCancel"
				},
				debug: false,

				// Button settings
				button_image_url: "Images/TestImageNoText_65x29.png",	// Relative to the Flash file
				button_width: "65",
				button_height: "29",
				button_placeholder_id: "spanButtonPlaceHolder",
//				button_text: '<span class="theFont">Hello</span>',
				button_text: '上传',
				button_text_style: ".theFont { font-size: 16; }",
				button_text_left_padding: 12,
				button_text_top_padding: 3,
				
				// The event handler functions are defined in handlers.js
				file_queued_handler : fileQueued,
				file_queue_error_handler : fileQueueError,
				file_dialog_complete_handler : fileDialogComplete,
				upload_start_handler : uploadStart,
				upload_progress_handler : uploadProgress,
				upload_error_handler : uploadError,
				upload_success_handler : uploadSuccess,
				upload_complete_handler : uploadComplete,
				queue_complete_handler : queueComplete	// Queue plugin event
			};

			swfu = new SWFUpload(settings);
	     };
	</script>
<style type="text/css">
<!--
body {
	background-color: #ddeef2;
}
-->
</style>
</head>

<body>
<div id="main_title"><a href="#">后台管理中心</a>—资讯发布</div>
<div id="main_content">
	<form action="<?php echo $this->_url('save',array('catid' => $catid,'access' => $_REQUEST['access'])); ?>" method="post" enctype="multipart/form-data" name="form1" id="form1" onsubmit="return fnOnSubmit(this);">
		<table width="100%" border="0" cellspacing="2" cellpadding="2">
			<tr>
				<td width="17%" class="title">*案例名称</td>
				<td>
					<input type="text" name="title" id="title" class="wp80" value="<?php echo $article['title']; ?>"/>
				</td>
			</tr>
			<tr>
				<td class="title">*所属类别</td>
				<td>
					<table border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td>
								<select name="pcid" size="1" id="pcid">
									<option value="0">--请选择--</option>
									<?php
                if (isset($article['pcid'])) {
                    $selectedClasses = (array)$article['pcid'];
                } else {
                    $selectedClasses = array();
                }
                foreach ($subclasses as $class){
                ?>
									<option value="<?php echo $class['class_id']; ?>"<?php if (in_array($class['class_id'], $selectedClasses)): ?>selected<?php endif; ?>>
									<?=$class['name']?>
									</option>
									<?php 
				}
                ?>
								</select>
							</td>
						</tr>
					</table>
				</td>
			</tr>			
			<tr>
				<td class="title">封面图片</td>
				<td>
					<?php if($article['image_src']): ?>
					<img src="<?php echo LEADTONE_DIR;?>/Upload/<?php echo $article['image_src']; ?>" width="300"><br />
					<?php endif; ?>
					<input name="postfile" type="file" size="40" />
				</td>
			</tr>
			<tr>
				<td class="title">资讯图片</td>
				<td>
					<div class="fieldset flash" id="fsUploadProgress"> </div>
					<div> <span id="spanButtonPlaceHolder">上传</span>
						<input id="btnCancel" type="hidden" value="Cancel All Uploads" onclick="swfu.cancelQueue();" disabled="disabled" style="margin-left: 2px; font-size: 8pt; height: 29px;" />
					</div>
				</td>
			</tr>
			<tr>
				<td valign="top" class="title">排序</td>
				<td>
					<input style="width:30px;" name="hot" id="hot" type="text" value="<?php echo $article['hot']; ?>"/>
					只能填0-99的正整数，值越大排名越靠前</td>
			</tr>
			<tr>
				<td align="right" colspan="2">
					<button type="submit" name="Save" id="Save" class="btnA">发布</button>
					&nbsp;&nbsp;
					<input name="Cancel" type="button" id="Cancel" value="<?php echo h(_T('ui_g_cancel')); ?>" onclick="fnOnBack();" />
				</td>
			</tr>
			<tr>
				<td>&nbsp;</td>
				<td></td>
			</tr>
		</table>
		<input name="<?php echo $pk; ?>" type="hidden" id="<?php echo $pk; ?>" value="<?php echo $article[$pk]; ?>"/>
	</form>
</div>
<div id="main_copy">Copyright&copy;2003 – 2009 ITeam Monkey. All Rights Reserved ITeam Monkey 版权所有 </div>
</body>
</html>
